package com.lyz.dataStructure.algorithm.tengxun2020;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 20:04
 * @Description:
 **/

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/8/17 20:04
 *@Description:
 **/

/*
输入
6
5 3 8 3 2 5
输出
3 3 5 4 4 4
 */
public class Main4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n  =sc.nextInt();
        int[] nums = new int[n];
        for(int i =0;i<n;i++){
            nums[i] = sc.nextInt();
        }
        List<Integer> list = new ArrayList<Integer>();
        int count = 2;
        int max = Integer.MIN_VALUE;
        int max1 = Integer.MIN_VALUE;
        for(int i =0;i<n;i++){
              if (i==0) {
                  for (int j = 0; j < n - 1; j++) {
                      if (nums[j] < nums[j + 1] && max < nums[j + 1]) {
                          count++;
                          // 5 3 8 3 2 5
                          max = Math.max(max, nums[j + 1]);
                      }
                  }
                  max = Integer.MIN_VALUE;
              }else if(i==nums.length-1){
                  for(int j =nums.length-1; j>=1;j--) {
                      if (nums[j] < nums[j-1] && max < nums[j-1]) {
                          count++;
                          // 5 3 8 3 2 5
                          max = Math.max(max, nums[j-1]);
                      }
                  }
                  max = Integer.MIN_VALUE;
              }else{
                  // 5 3 8 3 2 5
                  for(int j =i+1; j<n-1;j++) {
                      if(nums[j] < nums[j + 1] && max < nums[j + 1]){
                          count++;
                          max = Math.max(max, nums[j+1]);
                      }
                  }
                  for(int j =i-1; j>=1;j--) {
                      if(nums[j] < nums[j-1] && max1 < nums[j-1]){
                          count++;
                          max1 = Math.max(max1, nums[j-1]);
                      }
                  }
                  max = Integer.MIN_VALUE;
                  max1 = Integer.MIN_VALUE;
              }
            list.add(count);
            count = 2;
          }
        for(int i = 0;i<list.size();i++){
            System.out.printf(list.get(i)+" ");
        }
    }
}
